Optimal. Leaf size=26 \[ \frac {i a (c-i c \tan (e+f x))^n}{f n} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {3603, 3568, 32}
\begin {gather*} \frac {i a (c-i c \tan (e+f x))^n}{f n} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 32
Rule 3568
Rule 3603
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx &=(a c) \int \sec ^2(e+f x) (c-i c \tan (e+f x))^{-1+n} \, dx\\ &=\frac {(i a) \text {Subst}\left (\int (c+x)^{-1+n} \, dx,x,-i c \tan (e+f x)\right )}{f}\\ &=\frac {i a (c-i c \tan (e+f x))^n}{f n}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.42, size = 51, normalized size = 1.96 \begin {gather*} \frac {i a e^{n (-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))} (c \sec (e+f x))^n}{f n} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.22, size = 25, normalized size = 0.96
method | result | size |
derivativedivides | \(\frac {i a \left (c -i c \tan \left (f x +e \right )\right )^{n}}{f n}\) | \(25\) |
default | \(\frac {i a \left (c -i c \tan \left (f x +e \right )\right )^{n}}{f n}\) | \(25\) |
norman | \(\frac {i a \,{\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f n}\) | \(27\) |
risch | \(\frac {i a \,{\mathrm e}^{\frac {n \left (-i \pi \mathrm {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{3}+i \pi \mathrm {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \mathrm {csgn}\left (i c \right )+i \pi \mathrm {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )-i \pi \,\mathrm {csgn}\left (\frac {i c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )-2 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )+2 \ln \left (2\right )+2 \ln \left (c \right )\right )}{2}}}{f n}\) | \(176\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.52, size = 25, normalized size = 0.96 \begin {gather*} \frac {i \, a c^{n} {\left (-i \, \tan \left (f x + e\right ) + 1\right )}^{n}}{f n} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.17, size = 28, normalized size = 1.08 \begin {gather*} \frac {i \, a \left (\frac {2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 70 vs. \(2 (19) = 38\).
time = 0.21, size = 70, normalized size = 2.69 \begin {gather*} \begin {cases} x \left (i a \tan {\left (e \right )} + a\right ) & \text {for}\: f = 0 \wedge n = 0 \\a x + \frac {i a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} & \text {for}\: n = 0 \\x \left (i a \tan {\left (e \right )} + a\right ) \left (- i c \tan {\left (e \right )} + c\right )^{n} & \text {for}\: f = 0 \\\frac {i a \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{f n} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.22, size = 23, normalized size = 0.88 \begin {gather*} \frac {i \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n} a}{f n} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.86, size = 40, normalized size = 1.54 \begin {gather*} \frac {a\,{\left (\frac {2\,c}{\cos \left (2\,e+2\,f\,x\right )+1+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}}\right )}^n\,1{}\mathrm {i}}{f\,n} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________